package com.yunsc.store.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunsc.store.entity.YunscUserGradeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 用户会员等级表
 * 
 * @author adan
 * @email 2028038953@qq.com
 * @date 2024-04-05 01:37:43
 */
@Mapper
public interface YunscUserGradeDao extends BaseMapper<YunscUserGradeEntity> {

    @Select("SELECT *\n" +
            "FROM yunsc_user_grade yug\n" +
            "         left join yunsc_user yu on yu.grade_id = yug.grade_id\n" +
            "where yu.user_id = #{userId};")
    YunscUserGradeEntity selectUserGrade(Integer userId);
}
